<template>
	<view class="message">
		<view class="messageBox" v-for="item in info" :key="item.id">
			<view class="messageImg">
				<image :src="item.cover"></image>
			</view>
			<view class="messageContent">
				<view class="msgTitle">{{item.title}}</view>
				<view class="msgMeta">
					<view class="msgTime">{{item.createTime}}</view>
					<view class="msgViews">
						<uni-icons type="eye" size="16" color="#8D8888" class="icon"></uni-icons>
						{{item.visitNum || 0}}次
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name:"Message",
		props:{
			info: {
				type:Object
			}
		},
		data() {
			return {
				
			};
		}
	}
</script>

<style lang="scss">
.messageBox {
	display: flex;
	justify-content: space-evenly;
	align-items: center;
	width: 340px;
	height: 120px;
	background-color: #323232;
	color:#fff;
	border-radius: 8px;
	font-size: 14px;
	margin-bottom: 15px;
	
}
.messageImg > image {
	width: 120px;
	height: 80px;
	border-radius: 8px;
}
.messageContent {
	display: flex;
	flex-direction: column;
	justify-content: space-evenly;
	width: 200px;
	height: 86px;
}
.msgTitle {
	overflow : hidden;
	text-overflow: ellipsis;
	white-space: normal;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}
.msgMeta {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	height: 45px;
}
.msgTime,.msgViews {
	font-size: 12px;
	color: #8D8888;
}
.icon {
	vertical-align: middle;
}
</style>